export interface Inter {
  left: string
  right: string
  top: string
  bottom: string
}
function assign(left: string): Inter
function assign(left: string, top: string): Inter
function assign(left: string, top: string, right: string, bottom: string): Inter
function assign(left: string, top?: string, right?: string, bottom?: string) {
  if (top === undefined && right === undefined && bottom === undefined) {
    top = right = bottom = left
  } else if (right === undefined && bottom === undefined) {
    right = left
    bottom = top
  }
  return { left, right, top, bottom }
}
const result1 = assign('a', 'b', 'c', 'd')
const result2 = assign('a', 'b')
const result3 = assign('a')
console.log(result1, result2, result3)
